package presenter;

import java.util.List;

import base.BasePresenter;
import base.ResultCallBack;
import bean.LunTanSchoolNewsBean;
import model.LunTanNewsModel;
import view.LunTanNewsView;

/**
 * Created by zhang'lin'lin on 2019/11/6.
 */

public class LunTanNewsPresenter extends BasePresenter<LunTanNewsView> {
    private LunTanNewsModel model;

    public LunTanNewsPresenter() {
        this.model = new LunTanNewsModel();
        addModel(model);
    }

    public void getData(int id, int page) {
        model.getData(id,page, new ResultCallBack<List<LunTanSchoolNewsBean>>() {
            @Override
            public void onSuccess(List <LunTanSchoolNewsBean> lunTanSchoolNewsBeans) {
                if (mView!=null){
                    mView.onSuccess(lunTanSchoolNewsBeans);
                }
            }

            @Override
            public void onFail(String error) {
                if (mView!=null){
                    mView.onFail(error);
                }
            }
        });
    }
}
